# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>

pkgname=wallutils
pkgver=5.12.5
pkgrel=1
pkgdesc='Utilities for handling resolutions, wallpapers and timed wallpapers'
arch=(loong64 x86_64)
url='https://github.com/xyproto/wallutils'
license=(BSD)
depends=(libheif libx11 libxpm wayland)
makedepends=(git go libxcursor libxmu upx xbitmaps xorgproto)
optdepends=('feh: for setting the wallpaper for some window managers that runs under X'
  'imagemagick: for supporting HEIF/HEIC (macOS wallpaper) files'
  'nvidia-utils: for the vram utility'
  'procps-ng: for Labwc'
  'swaybg: for Sway and Labwc')
source=("git+$url#commit=7d7ad270a4ae787358e72d35fbb8e7c57a7d3caa") # tag: 5.12.5
options=(!strip !lto)
b2sums=('SKIP')

build() {
  make -C $pkgname
}

package() {
  DESTDIR="$pkgdir" make -C $pkgname install
  find "$pkgdir/usr/bin/" -executable -type f -exec upx -q --no-progress {} >/dev/null \;
  install -Dm644 $pkgname/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
